﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Dept_Role_Manage.aspx.cs"
    Inherits="SYS_POPEDOM_Dept_Role_Manage" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .no-icon {
            display: none;
        }
    </style>
    <link href="../css/PageStyle.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../JavaScript/Common.js"></script>
    <script type="text/javascript">

        function nodeLoad(node) {
            Ext.net.DirectMethods.NodeLoad(node.id, {
                success: function (result) {
                    var data = eval("(" + result + ")");
                    node.loadNodes(data);
                },

                failure: function (errorMsg) {
                    Ext.Msg.alert('Failure', errorMsg);
                }
            });
        }

        function nodeClick(node) {
            Ext.net.DirectMethods.NodeClick(node.id);
        }

        function clickNode(node) {
            TreePanel1.fireEvent("click", node);
        }

        function refreshTree() {
            TreePanel1.getSelectionModel().getSelectedNode().reload();
        }

        function hasSelCount() {
            var count = GridPanel1.getSelectionModel().selections.length;
            if (count == 0) {
                Ext.Msg.alert('系统提示', '请先选择一个记录！');
                return false;
            }
            else
                return true;
        }

    </script>

</head>
<body>
    <form id="form1" runat="server">
        <div>
            <ext:ResourceManager ID="ResourceManager1" runat="server" AjaxViewStateMode="Enabled" />
            <ext:Store ID="Store1" runat="server" AutoLoad="true">
                <Reader>
                    <ext:JsonReader IDProperty="MASTER_ID">
                        <Fields>
                            <ext:RecordField Name="MASTER_ID" />
                            <ext:RecordField Name="DEPT_ID" />
                            <ext:RecordField Name="ROLE_ID" />
                            <ext:RecordField Name="DEPT_NAME" />
                            <ext:RecordField Name="ROLE_NAME" />
                            <ext:RecordField Name="NOTES" />
                        </Fields>
                    </ext:JsonReader>
                </Reader>
                <SortInfo Direction="ASC"></SortInfo>
            </ext:Store>
            <ext:Viewport ID="Viewport1" runat="server" HideBorders="true">
                <Items>
                    <ext:ColumnLayout ID="ColumnLayout1" runat="server" Split="false" FitHeight="true">
                        <Columns>
                            <ext:LayoutColumn ColumnWidth="0.25">
                                <ext:Panel ID="Panel1" runat="server" Border="false" Layout="Fit">
                                    <Items>
                                        <ext:TreePanel ID="TreePanel1" runat="server" Collapsible="false" AutoScroll="true"
                                            Animate="true" BodyBorder="false">
                                            <Listeners>
                                                <BeforeLoad Fn="nodeLoad" />
                                                <Click Fn="nodeClick" />
                                                <ExpandNode Fn="clickNode" />
                                                <CollapseNode Fn="clickNode" />
                                            </Listeners>
                                            <TopBar>
                                                <ext:Toolbar ID="Toolbar2" runat="server" Height="26">
                                                    <Items>
                                                        <ext:ToolbarTextItem Text="部门信息" Height="40">
                                                        </ext:ToolbarTextItem>
                                                        <ext:ToolbarFill ID="ToolbarFill2" runat="server" />
                                                        <ext:Button ID="Button4" runat="server" Text="" Width="0px" Disabled="true">
                                                        </ext:Button>
                                                    </Items>
                                                </ext:Toolbar>
                                            </TopBar>
                                        </ext:TreePanel>
                                    </Items>
                                </ext:Panel>
                            </ext:LayoutColumn>
                            <ext:LayoutColumn ColumnWidth="0.75">
                                <ext:Panel ID="Panel2" runat="server" BodyStyle="border-width:0 0 0 1px;" Layout="Fit">
                                    <Items>
                                        <ext:GridPanel ID="GridPanel1" runat="server" StoreID="Store1" Border="false" AutoWidth="true"
                                            Layout="Fit">
                                            <ColumnModel>
                                                <Columns>
                                                    <ext:RowNumbererColumn Header="序号" Width="35">
                                                    </ext:RowNumbererColumn>
                                                    <ext:Column Header="" DataIndex="MASTER_ID" Width="150" Hidden="true" />
                                                    <ext:Column Header="角色名称" DataIndex="ROLE_NAME" Width="150" />
                                                    <ext:Column Header="部门名称" DataIndex="DEPT_NAME" Width="150" />
                                                    <ext:Column Header="备注" DataIndex="NOTES" Width="300" />
                                                </Columns>
                                            </ColumnModel>
                                            <SelectionModel>
                                                <ext:RowSelectionModel ID="RowSelectionModel1" runat="server">
                                                </ext:RowSelectionModel>
                                            </SelectionModel>
                                            <TopBar>
                                                <ext:Toolbar ID="Toolbar1" runat="server">
                                                    <Items>
                                                        <ext:Button ID="extBtn_Add" runat="server" Icon="Add" Text="新增">
                                                        </ext:Button>
                                                        <ext:Button ID="extBtn_Del" runat="server" Icon="Delete" Text="删除">
                                                            <DirectEvents>
                                                                <Click OnEvent="DelDept" />
                                                            </DirectEvents>
                                                        </ext:Button>
                                                    </Items>
                                                </ext:Toolbar>
                                            </TopBar>
                                        </ext:GridPanel>
                                    </Items>
                                </ext:Panel>
                            </ext:LayoutColumn>
                        </Columns>
                    </ext:ColumnLayout>
                </Items>
            </ext:Viewport>
        </div>
        <ext:Hidden ID="exthid_deptId" runat="server"></ext:Hidden>
    </form>
</body>
</html>
